<?php

include_once '../common_mbs.inc.php';
include_once '../smarty.inc.php';

//判断访问权限
$admin_index_module_obj = new osgh_admin_index_module_cls();
$is_warrant = $admin_index_module_obj->is_have_warrant($_ADMIN_ID,'news_type_list');
if(!$is_warrant) tcmc_cls::ShowMsg("没有权限访问！", "../index_body.html");


$news_type_obj = new news_type_cls();
$news_type_name = isset($_REQUEST['news_type_name']) ? trim($_REQUEST['news_type_name']) : '';
$where_str = "news_type_name like '%{$news_type_name}%'";
$count = $news_type_obj->get_news_type_list(true, $where_str);

$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;

$p = new show_page_cls;
$page_size = 30;
$p -> pvar="page";
$p -> setvar(array("news_type_name"=>$news_type_name));
$p -> set($page_size,$count,$page);
$page_str = $p -> output(true);
$limit = $p -> limit();

$typeList = $news_type_obj->get_news_type_list(false, $where_str, "od DESC", $limit);

$smarty -> assign('news_type_name' , $news_type_name);
$smarty -> assign('typelist', $typeList);
$smarty -> assign('page_str' , $page_str);
$smarty -> display('news/news_type_list.tpl');

?>
